﻿using AutoRegistDependency.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoRegistDependency.Attributes
{
    /// <summary>
    /// 组件注入特性。可以标记在类上。
    /// Component、Confignature、Job以及ConfigurationProperties特性在同一个类上只能有一个。
    /// Component injection attribute. Can be marked on a class. 
	/// The Component, Configure,Job,ConfigurationProperties attributes can only have one on the same class.
    /// </summary>
    [Unique]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public sealed class ComponentAttribute : Attribute
    {
        /// <summary>
        /// 是否自动激活实例
        /// </summary>
        public bool AutoActivate { get; set; }
        /// <summary>
        /// 服务name
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 生命周期
        /// </summary>
        public LifeTimeType Lifetime { get; set; }
        /// <summary>
        /// 属性注入类型
        /// </summary>
        public PropertyInjectType PropertyInjectType { get; set; }
        /// <summary>
        /// 注册方式
        /// </summary>
        public RegistrationType RegistrationType { get; set; }
        /// <summary>
        /// 服务key
        /// </summary>
        public object Key { get; set; }

    }
}
